//求两个数组的并集，交集，差集
const arr1=[33,34,22,55,66,45,20,20,56,23,3,89];
const arr2=[13,34,20,55,66,95,55,29,39,9];

// 并集
const union=[...new Set([...arr1,...arr2])];
console.log(union);

// 交集
const cross=[...new Set(arr1.filter((item)=>arr2.includes(item)))];
console.log(cross);

// 差集
const diff=union.filter((item)=>!cross.includes(item));
console.log(diff);